
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>11.2.1 基础 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="docker_pro.html" />
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    理想未死
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <span>
            
                    
                    1. java基础
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" >
            
                <span>
            
                    
                    1.1 数据类型
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.1" data-path="../java/basic/string.html">
            
                <a href="../java/basic/string.html">
            
                    
                    1.1.1 字符串
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.2" data-path="../java/basic/num.html">
            
                <a href="../java/basic/num.html">
            
                    
                    1.1.2 数字
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.3" data-path="../java/basic/date.html">
            
                <a href="../java/basic/date.html">
            
                    
                    1.1.3 日期
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.2" >
            
                <span>
            
                    
                    1.2 集合
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.2.1" data-path="../java/basic/list.html">
            
                <a href="../java/basic/list.html">
            
                    
                    1.2.1 list
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2.2" data-path="../java/basic/map.html">
            
                <a href="../java/basic/map.html">
            
                    
                    1.2.2 map
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2.3" data-path="../java/basic/arr.html">
            
                <a href="../java/basic/arr.html">
            
                    
                    1.2.3 数组
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../java/basic/guifan.html">
            
                <a href="../java/basic/guifan.html">
            
                    
                    1.3 编码规范
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    2. 版本控制
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../java/git.html">
            
                <a href="../java/git.html">
            
                    
                    2.1 git
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../java/gradle.html">
            
                <a href="../java/gradle.html">
            
                    
                    2.4 gradle
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    3. 常用技术
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../java/patzn/poi.md">
            
                <span>
            
                    
                    3.1 poi
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1.1" data-path="../java/poi.html">
            
                <a href="../java/poi.html">
            
                    
                    3.1.1 原生poi
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.1.2" data-path="../java/poi.html">
            
                <a href="../java/poi.html">
            
                    
                    3.1.2 easypoi
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    4. 常用框架
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../java/example2.md">
            
                <span>
            
                    
                    4.1 springboot
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../java/patzn/mybatis.md">
            
                <span>
            
                    
                    4.2 mybatisPlus
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../java/ali.html">
            
                <a href="../java/ali.html">
            
                    
                    4.3 spring cloud alibaba
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" >
            
                <span>
            
                    
                    5. 中间件
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../java/rocket.md">
            
                <span>
            
                    
                    5.1 rockermq
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" >
            
                <span>
            
                    
                    5.2 Arthas(线上诊断工具)
            
                </span>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../java/jvm.html">
            
                <a href="../java/jvm.html">
            
                    
                    6. jvm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../java/example2.md">
            
                <span>
            
                    
                    7. 设计模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../java/patzn/readme.md">
            
                <span>
            
                    
                    8. 工具类
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../java/patzn/upload.md">
            
                <span>
            
                    
                    8.1 上传&下载
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../java/patzn/input.md">
            
                <span>
            
                    
                    8.2 导入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../java/patzn/debris.md">
            
                <span>
            
                    
                    8.3 其他
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" >
            
                <span>
            
                    
                    9. 前端
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../js/debris.html">
            
                <a href="../js/debris.html">
            
                    
                    9.1 碎片
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../java/example2.md">
            
                <span>
            
                    
                    9.2 vue
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../java/example2.md">
            
                <span>
            
                    
                    9.3 react
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="../java/example2.md">
            
                <span>
            
                    
                    9.4 node.js
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" >
            
                <span>
            
                    
                    10. 数据库
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../sql/mysql.html">
            
                <a href="../sql/mysql.html">
            
                    
                    10.1 设计规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../sql/pgsql.html">
            
                <a href="../sql/pgsql.html">
            
                    
                    10.2 常用函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../sql/design.html">
            
                <a href="../sql/design.html">
            
                    
                    10.3 海量数据处理
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" >
            
                <span>
            
                    
                    11. 运维
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="linux.html">
            
                <a href="linux.html">
            
                    
                    11.1 linux
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.2" >
            
                <span>
            
                    
                    11.2 docker
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.12.2.1" data-path="docker_basic.html">
            
                <a href="docker_basic.html">
            
                    
                    11.2.1 基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.2.2" data-path="docker_pro.html">
            
                <a href="docker_pro.html">
            
                    
                    11.2.2 进阶
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12.3" data-path="nginx.html">
            
                <a href="nginx.html">
            
                    
                    11.3 nginx
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.4" data-path="jenkins.html">
            
                <a href="jenkins.html">
            
                    
                    11.4 jenkins
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../mac/experience.html">
            
                <a href="../mac/experience.html">
            
                    
                    12. 操作系统
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >11.2.1 基础</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="docker-&#x5BB9;&#x5668;">docker &#x5BB9;&#x5668;</h2>
<p>&#x4E00;&#x3001;docker &#x5B89;&#x88C5;</p>
<pre><code>&#x5B98;&#x65B9;&#x6587;&#x6863;&#x5730;&#x5740;:    https://docs.docker.com/engine/install/centos/   
1.&#x5378;&#x8F7D;&#x65E7;&#x7684;&#x7248;&#x672C;
$ sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine
2.&#x9700;&#x8981;&#x7684;&#x5B89;&#x88C5;&#x5305;
$ sudo yum install -y yum-utils
3.&#x8BBE;&#x7F6E;&#x955C;&#x50CF;&#x4ED3;&#x5E93;&#xFF08;&#x963F;&#x91CC;&#x4E91; &#x901F;&#x5EA6;&#x5FEB;&#xFF09;
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
4.&#x66F4;&#x65B0;&#x8F6F;&#x4EF6;&#x5305;&#x7D22;&#x5F15;
yum makecache fast
5.&#x5B89;&#x88C5;docker  ce &#x793E;&#x533A;&#x7248;
sudo yum install docker-ce docker-ce-cli containerd.io
6.&#x542F;&#x52A8;docker
sudo systemctl start docker

docker version  &#x6D4B;&#x8BD5;&#x662F;&#x5426;&#x5B89;&#x88C5;&#x6210;&#x529F;
docker images &#x67E5;&#x770B;&#x4E0B;&#x8F7D;&#x7684;&#x955C;&#x50CF;
7.&#x5378;&#x8F7D;docker
sudo yum remove docker-ce docker-ce-cli containerd.io
sudo rm -rf /var/lib/docker

8.&#x914D;&#x7F6E;&#x955C;&#x50CF;&#x52A0;&#x901F;&#xFF08;&#x963F;&#x91CC;&#x4E91;&#x955C;&#x50CF;&#x52A0;&#x901F;&#xFF09;
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json &lt;&lt;-&apos;EOF&apos;
{
  &quot;registry-mirrors&quot;: [&quot;https://qwiql8b0.mirror.aliyuncs.com&quot;]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
</code></pre><p>&#x4E8C;&#x3001;&#x57FA;&#x672C;&#x547D;&#x4EE4;</p>
<pre><code>docker version
docker info
docker &#x547D;&#x4EE4;  --help 
&#x955C;&#x50CF;
docker images   &#x67E5;&#x770B;&#x672C;&#x5730;&#x6240;&#x6709;&#x955C;&#x50CF;
    -a  &#x67E5;&#x770B;&#x6240;&#x6709;&#x955C;&#x50CF;
    -q  &#x663E;&#x793A;&#x6240;&#x6709;id
docker search  &#x641C;&#x7D22;    
    -filter=STARS=3000 &#x641C;&#x7D22;stars &#x4E0D;&#x5C0F;&#x4E8E;&#x4E09;&#x5343;
docker pull  &#x4E0B;&#x8F7D;&#x955C;&#x50CF;
    docker pull mysql:5.7   &#x6307;&#x5B9A;&#x7248;&#x672C;&#x4E0B;&#x8F7D;
docke  -rmi -f  &#x5BB9;&#x5668;id    &#x5220;&#x9664;&#x6307;&#x5B9A;&#x5BB9;&#x5668;/&#x6240;&#x6709;
    docker -rmi -f $(docker images -aq) &#x5220;&#x9664;&#x6240;&#x6709;&#x5BB9;&#x5668;
&#x5BB9;&#x5668;
docker run [&#x53EF;&#x9009;&#x53C2;&#x6570;] image &#x542F;&#x52A8;&#x5BB9;&#x5668;
    --name &#x5236;&#x5B9A;&#x5BB9;&#x5668;&#x540D;&#x79F0;
    -d &#x540E;&#x53F0;&#x65B9;&#x5F0F;&#x8FD0;&#x884C;
    -it &#x4EA4;&#x4E92;&#x65B9;&#x5F0F;&#x8FD0;&#x884C;&#xFF0C;&#x8FDB;&#x5165;&#x5BB9;&#x5668;&#x67E5;&#x770B;&#x5185;&#x5BB9;
    -P &#x6307;&#x5B9A;&#x5BB9;&#x5668;&#x7684;&#x7AEF;&#x53E3;
        &#x2014;P ip:&#x4E3B;&#x673A;&#x5730;&#x5740;&#xFF1A;&#x5BB9;&#x5668;&#x7AEF;&#x53E3;&#x53F7;
        -P &#x4E3B;&#x673A;&#x7AEF;&#x53E3;&#x53F7;&#xFF1A;&#x5BB9;&#x5668;&#x7AEF;&#x53E3;&#xFF08;&#x5E38;&#x7528;&#xFF09;
        -P &#x5BB9;&#x5668;&#x7AEF;&#x53E3;
    -p &#x6307;&#x5B9A;&#x968F;&#x673A;&#x7AEF;&#x53E3;

docker run it centos /bin/bash   

docker ps
   -a  &#x5217;&#x51FA;&#x5386;&#x53F2;&#x8FD0;&#x884C;&#x5BB9;&#x5668;&#x548C;&#x6B63;&#x5728;&#x8FD0;&#x884C;&#x7684;
   -n=? &#x663E;&#x793A;&#x6700;&#x8FD1;&#x521B;&#x5EFA;&#x7684;&#x5BB9;&#x5668;
   -q   &#x53EA;&#x663E;&#x793A;&#x7F16;&#x53F7;
&#x9000;&#x51FA;&#x5BB9;&#x5668;  
exit  &#x76F4;&#x63A5;&#x505C;&#x6B62;&#x9000;&#x51FA;
ctrl+p+q   &#x4E0D;&#x505C;&#x6B62;&#x9000;&#x51FA;
&#x5220;&#x9664;&#x5BB9;&#x5668; 
docker rm &#x5BB9;&#x5668;id     &#x5220;&#x9664;&#x6307;&#x5B9A;id&#x5BB9;&#x5668;&#xFF0C;&#x4E0D;&#x80FD;&#x5220;&#x9664;&#x6B63;&#x5728;&#x8FD0;&#x884C;&#x7684;&#x5BB9;&#x5668;
docker rm -f $(docker ps -aq)  &#x5220;&#x9664;&#x6240;&#x6709;&#x5BB9;&#x5668;
docker ps -a -qlxargs docker rm &#x5220;&#x9664;&#x6240;&#x6709;&#x5BB9;&#x5668;

&#x542F;&#x52A8;&#x548C;&#x505C;&#x6B62;&#x5BB9;&#x5668;
docker start &#x5BB9;&#x5668;id 
docker restart &#x5BB9;&#x5668;id
docker stop &#x5BB9;&#x5668;id
    docker kill &#x5BB9;&#x5668;id

&#x5E38;&#x7528;&#x5176;&#x4ED6;&#x547D;&#x4EE4;
docker run -d &#x955C;&#x50CF;&#x540D;
&#x9700;&#x8981;&#x4E00;&#x4E2A;&#x524D;&#x53F0;&#x8FDB;&#x7A0B;&#x5426;&#x5219;&#x5C31;&#x4F1A;&#x81EA;&#x52A8;&#x5173;&#x95ED;
&#x67E5;&#x770B;&#x65E5;&#x5FD7;
docker logs
    -tf  &#x663E;&#x793A;&#x65E5;&#x5FD7;
    --tail number  &#x663E;&#x793A;&#x6307;&#x5B9A;&#x6761;&#x6570;&#x7684;&#x65E5;&#x5FD7;
&#x67E5;&#x770B;&#x5BB9;&#x5668;&#x5185;&#x90E8;&#x8FDB;&#x7A0B;&#x4FE1;&#x606F;
docker top &#x5BB9;&#x5668;id
docker inspect &#x5BB9;&#x5668;id  &#x5BB9;&#x5668;&#x5143;&#x6570;&#x636E;

&#x8FDB;&#x5165;&#x5230;&#x6B63;&#x5728;&#x8FD0;&#x884C;&#x7684;&#x5BB9;&#x5668;
docker exec -it &#x5BB9;&#x5668;id /bin/bash   &#x8FDB;&#x5165;&#x5BB9;&#x5668;&#x540E;&#x5F00;&#x542F;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x7EC8;&#x7AEF;
docker attach &#x5BB9;&#x5668;id               &#x8FDB;&#x5165;&#x5BB9;&#x5668;&#x6B63;&#x5728;&#x6267;&#x884C;&#x7684;&#x7EC8;&#x7AEF;&#xFF0C;&#x4E0D;&#x542F;&#x52A8;&#x65B0;&#x7684;&#x8FDB;&#x7A0B;

&#x4ECE;&#x5BB9;&#x5668;&#x4E2D;&#x62F7;&#x8D1D;&#x6587;&#x4EF6;&#x5230;&#x4E3B;&#x673A;&#x4E0A;
docker cp &#x5BB9;&#x5668;id:&#x6587;&#x4EF6;&#x8DEF;&#x5F84;  &#x4E3B;&#x673A;&#x8DEF;&#x5F84;
</code></pre><p><strong>&#x4E09;.&#x4F8B;&#x5B50;</strong></p>
<p>&#x90E8;&#x7F72;nginx</p>
<pre><code>1.&#x5B98;&#x7F51;&#x6216;&#x8005;docker research &#x67E5;&#x8BE2;&#x955C;&#x50CF;
2.&#x4E0B;&#x8F7D;&#x955C;&#x50CF;  docker pull nginx
3.&#x542F;&#x52A8;&#x5BB9;&#x5668; docker run  -d --name nginx -p 3344:80  nginx
    &#x5F00;&#x542F;&#x5BBF;&#x4E3B;&#x673A; 3344&#x7AEF;&#x53E3;
    1.firewall-cmd --get-active-zones
        &#x5982;&#x679C;&#x63D0;&#x793A;&#x9632;&#x706B;&#x5899;&#x672A;&#x5F00;&#x542F;&#x7684;&#x8BDD;&#xFF0C;&#x5148;&#x5F00;&#x542F;&#x9632;&#x706B;&#x5899;
        systemctl start firewalld
        systemctl stop firewalld //&#x5173;&#x95ED;&#x9632;&#x706B;&#x5899;
    2.firewall-cmd --zone=public --add-port=3344/tcp --permanent
    3.firewall-cmd --reload &#x91CD;&#x542F;&#x9632;&#x706B;&#x5899;
    4.firewall-cmd --query-port=3344/tcp &#x67E5;&#x770B;&#x662F;&#x5426;&#x5F00;&#x542F;&#x6210;&#x529F;  yes &#x4EE3;&#x8868;&#x6210;&#x529F;
    &#x8FD9;&#x4E00;&#x6B65;&#x4E4B;&#x540E;,&#x5BBF;&#x4E3B;&#x673A;&#x7684;3344&#x7AEF;&#x53E3;&#x5DF2;&#x7ECF;&#x5F00;&#x542F;&#xFF0C;&#x4F46;&#x662F;&#x6267;&#x884C;&#x542F;&#x52A8;&#x5BB9;&#x5668;&#x7684;&#x547D;&#x4EE4;&#x4F1A;&#x62A5;&#x9519;
     (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport     3305 -j DNAT --to-destination 172.18.0.2:80 ! -i docker0: iptables: No     chain/target/match by that name.
    &#x6B64;&#x65F6;&#x91CD;&#x542F;&#x4E00;&#x4E0B;docker &#x670D;&#x52A1;&#x5373;&#x53EF;&#x89E3;&#x51B3;&#x95EE;&#x9898;
    sudo systemctl restart docker
4.curl localhost:3344
</code></pre><p>&#x90E8;&#x7F72;tomcat</p>
<pre><code>docker run -it --rm tomcat:9.0  &#x7528;&#x5B8C;&#x5373;&#x5220;  &#x4E00;&#x822C;&#x6D4B;&#x8BD5;&#x7528;
&#x542F;&#x52A8;&#x5BB9;&#x5668;&#x62A5;&#x9519;
The container name &quot;/xxx&quot; is already in use by container ......
&#x67E5;&#x770B; &#x6240;&#x6709;&#x7684;&#x5BB9;&#x5668;
docker ps  -a
&#x5220;&#x9664;&#x5BB9;&#x5668; 
docker rm &#x5BB9;&#x5668;id
&#x518D;&#x542F;&#x52A8;
docker run -d -p 3304:8080 --name tomcat01 tomcat

cp webapps.dist/* -r webapps/  &#x628A; webapps.dist &#x4E0B;&#x7684;&#x5185;&#x5BB9;&#x590D;&#x5236;&#x5230; webapps &#x4E0B;
</code></pre><p>&#x90E8;&#x7F72;elasticsearch</p>
<pre><code>docker stats &#x67E5;&#x770B;cpu &#x4F7F;&#x7528;&#x72B6;&#x51B5;

&#x8BBE;&#x7F6E;elasticsearch&#x7684;&#x5185;&#x5B58;&#x533A;&#x95F4;
docker run -d --name elasticsearch --net somenetwork -p 9200:9200 -p 9300:9300 -e ES_JAVA_OPTS=&quot;-Xms64m -Xmx512m&quot; -e &quot;discovery.type=single-node&quot; elasticsearch:tag

docker&#x53EF;&#x89C6;&#x5316;&#x5DE5;&#x5177;portainer
docker volume create portainer_data

docker run -d -p 9000:9000 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

&#x8054;&#x5408;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#xFF0C;&#x5C42;&#x7EA7;&#x6982;&#x5FF5;
</code></pre>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                
                <a href="docker_pro.html" class="navigation navigation-next navigation-unique" aria-label="Next page: 11.2.2 进阶">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"11.2.1 基础","level":"1.12.2.1","depth":3,"next":{"title":"11.2.2 进阶","level":"1.12.2.2","depth":3,"path":"linux/docker_pro.md","ref":"linux/docker_pro.md","articles":[]},"previous":{"title":"11.2 docker","level":"1.12.2","depth":2,"ref":"","articles":[{"title":"11.2.1 基础","level":"1.12.2.1","depth":3,"path":"linux/docker_basic.md","ref":"linux/docker_basic.md","articles":[]},{"title":"11.2.2 进阶","level":"1.12.2.2","depth":3,"path":"linux/docker_pro.md","ref":"linux/docker_pro.md","articles":[]}]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"linux/docker_basic.md","mtime":"2020-09-20T02:21:25.689Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-03-20T06:16:02.011Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

